package cn.zcib.film.service.impl;

import cn.zcib.film.anno.Record;
import cn.zcib.film.bean.Type;
import cn.zcib.film.bean.vo.TypeVO;
import cn.zcib.film.mapper.TypeMapper;
import cn.zcib.film.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeMapper typeMapper;

    @Override
    public List<Type> findTypes(TypeVO typeVO) {
        return typeMapper.findTypes(typeVO);
    }

    @Override
    public Integer addType(Type type) {
        return typeMapper.insertType(type);
    }

    @Override
    public Integer modType(Type type) {
        return typeMapper.updateType(type);
    }

    @Override
    public Integer deleteById(Integer typeId) {
        return typeMapper.deleteById(typeId);
    }

    @Override
    public Integer deleteByIds(List<Integer> tIds) {
        return typeMapper.deleteByIds(tIds);
    }

    @Override
    public List<Map<String, Integer>> getUserTopType() {
        return typeMapper.getUserTopType();
    }
}
